const { DataTypes } = require("sequelize")
const sequelize = require("../db/sequelize")

const Tag = sequelize.define('tag', {
  name: {
    type: DataTypes.STRING,
    validate: {
      len: [2, 10]
    },
    allowNull: false,
    unique: true,
    comment: '标签的名称'
  }
}, {
  tableName: 'tags',
  charset: 'utf8'
})

module.exports = Tag
